from pathlib import Path as P

DEL_LINES = [
    'from src.utils import *',
    'from .utils import *',
    'from src.visualize import *',
]

CAT_FILES = [
    'src/utils.py',
    'src/model.py',
]

outfile = P("notebook_code.py")

lines = []
for f in CAT_FILES:
    lines.extend(P(f).read_text(encoding='utf8').splitlines())

out = open(outfile, 'w')
for line in lines:
    if any(x == line for x in DEL_LINES):
        continue
    out.write(line + '\n')

out.write('\ndo_submit(ResampleEnsemble)\n')

out.close()
print('Done')
